package com.zs.grain.di.components

import android.app.Application
import com.zs.grain.MyApplication
import com.zs.grain.di.modules.*
import dagger.BindsInstance

import javax.inject.Singleton

import dagger.Component
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule

/**
 * Created by Wesley on 2017/7/6.
 */

@Singleton
@Component(
    modules = arrayOf(
        AppModule::class,
        AndroidModule::class,
        GreenDaoModule::class,
        AndroidSupportInjectionModule::class
    )
)
public interface AppComponent : AndroidInjector<MyApplication> {
    @Component.Builder
    interface Builder {

        @BindsInstance
        fun application(application: Application): Builder

        fun build(): AppComponent
    }
}